//
//  BGTabBarViewController.m
//  bigMall
//
//  Created by LTOVE on 16/7/5.
//  Copyright © 2016年 thinklev. All rights reserved.
//

#import "BGTabBarViewController.h"
#import "BGHomeTableViewController.h"
#import "BGShopTableViewControler.h"
#import "BGTenderTableViewController.h"
#import "BGAuctionTableViewController.h"
#import "BGProfileViewController.h"
#import "BGNavigatiionController.h"
#import "AFNetworking.h"
@interface BGTabBarViewController ()

@end

@implementation BGTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
//    [NSThread sleepForTimeInterval:8.0];
    //创建TabBar的管理体系
    
    [self createTabBar];
    
    AFNetworkReachabilityManager *mgr = [AFNetworkReachabilityManager sharedManager];
    [mgr setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithObjectsAndKeys:@"1",@"key", nil];
        switch (status) {
//            case AFNetworkReachabilityStatusReachableViaWiFi:
//                GWLog(@"Wi_Fi");
//                break;
//            case AFNetworkReachabilityStatusReachableViaWWAN:
//                GWLog(@"自带网络");
//                break;
//            case AFNetworkReachabilityStatusUnknown:
//                GWLog(@"未知网络");
//                
//                break;
            case AFNetworkReachabilityStatusNotReachable:
                GWLog(@"没有网络");
                [dic setValue:@"0" forKey:@"key"];
                [[NSNotificationCenter defaultCenter] postNotificationName:@"netWorkStatus" object:nil userInfo:dic];
                break;
                
            default:
                [dic setValue:@"1" forKey:@"key"];
                [[NSNotificationCenter defaultCenter] postNotificationName:@"netWorkStatus" object:nil userInfo:dic];
                
                break;
        }
    }];
    [mgr startMonitoring];
    
}


-(void)dealloc
{
    [[AFNetworkReachabilityManager sharedManager] stopMonitoring];
}

- (void)createTabBar {
    
      //TabBar
    BGNavigatiionController *nav = [[BGNavigatiionController alloc] init];
    
    self.viewControllers = [nav createNavigation];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
